import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

//public class LiubotaoServlet2 extends GenericServlet {
//public void service(ServletRequest request, ServletResponse response)
//        throws ServletException, IOException {
//        PrintWriter out = response.getWriter();
//        out.println("Hello World  service()");
//        System.out.println("service()");
//        }
public class LiubotaoServlet2 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PrintWriter out = resp.getWriter();
        out.println("Hello World  service():doGet");
        System.out.println("service()  :  doGet() ");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PrintWriter out = resp.getWriter();
        out.println("Hello World  service():doPost");
        System.out.println("service()  :  doPost() ");
    }

    @Override
    public void init() throws ServletException {
        System.out.println("init()");
    }

    @Override
    public void destroy() {

        System.out.println("liuobtao  destroy()");
    }
}
